<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/4/16
 * Time: 10:51
 */

namespace app\common\validate;


use think\Validate;

class SuppliersCompany extends Validate
{
    protected $rule = [ // 定义验证规则
        'id|公司id' => 'require|number',
        'suppliers_company_name|公司名称' => 'require|unique:SuppliersCompany',
        'contact_person_name|联系人姓名' => 'require',
        'contact_person_phone|联系人电话' => 'require',
        'tax_rate|税率' => 'require',
        'address_area|省市区区域' => 'require',
        'address_detail|详细地址' => 'require',
        'service_brand|服务品牌' => 'require',
        'username|登录账号' => 'require',
        'password|登录密码' => 'require',
    ];

    protected $message = [ // 定义验证提示

    ];

    protected $scene = [ // 定义验证场景
        'add' => ['suppliers_company_name','contact_person_name','contact_person_phone','tax_rate','address_area','address_detail','service_brand','username','password'],
        'save' => ['id','suppliers_company_name.unique'=>'SuppliersCompany,id^company_name'],
    ];
}